package com.hyl.ssm.dao;

import com.hyl.ssm.entity.Pet;

/**
 * PetFactory
 *
 * @author hyl
 * @date 2024-12-12
 */
public class PetFactory {
    public static PetDao createPet(String key) {
        PetDao petDao = null;
        switch (key) {
            case "jdbc": //名称：petDaoJDBCImpl 类型：com.hyl.ssm.dao.PetDaoJDBCImpl
                petDao = new PetDaoJDBCImpl();
                break;
            case "mybatis":
                petDao = new PetDaoMybatisImpl();
                break;
        }
        return petDao;
    }
}
